//
//  GetPasswordAgainViewController.m
//  GetPowerDBO
//
//  Created by 周博 on 2017/8/1.
//  Copyright © 2017年 BogoZhou. All rights reserved.
//

#import "GetPasswordAgainViewController.h"

@interface GetPasswordAgainViewController ()<UITextFieldDelegate>

@end

@implementation GetPasswordAgainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self UISetting];
}

- (void)UISetting{
    
    _viewCenter.layer.masksToBounds = YES;
    _viewCenter.backgroundColor = [kWhiteColor colorWithAlphaComponent:0.95];
    _viewCenter.layer.cornerRadius = 10;

    [_textField1 becomeFirstResponder];
}

#pragma mark - 点击事件

- (IBAction)backButtonClick:(UIButton *)sender {
    [self dismissViewControllerAnimated:NO completion:nil];
}

- (IBAction)beginEditing:(UITextField *)sender {
    _textField2.text = @"";
    _textField3.text = @"";
}


- (IBAction)textFieldValueChangeFunc:(UITextField *)sender {
    if (sender == _textField1) {
        _textField2.text = @"";
        _textField3.text = @"";
        _textField1.enabled = NO;
        _textField2.enabled = YES;
        [_textField1 resignFirstResponder];
        [_textField2 becomeFirstResponder];
    }else if (sender == _textField2){
        _textField3.text = @"";
        _textField2.enabled = NO;
        _textField3.enabled = YES;
        [_textField2 resignFirstResponder];
        [_textField3 becomeFirstResponder];
    }else{
        _textField3.enabled = NO;
        _textField1.enabled = YES;
        [_textField3 resignFirstResponder];
        [_delegate getStepNum:[NSString stringWithFormat:@"%@%@%@",_textField1.text,_textField2.text,_textField3.text]];
        [self dismissViewControllerAnimated:NO completion:nil];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
